package edu.njucm.herbiv

import edu.njucm.herbiv.dao.ChemicalRepository
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest
import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager
import org.springframework.data.domain.PageRequest
import org.springframework.data.domain.Sort

/**
 * @Author ZhouHang
 * @Date 24/5/12 012
 */
@DataJpaTest
class RepositoriesTests @Autowired constructor(
    val entityManager: TestEntityManager,
    val chemicalRepository: ChemicalRepository
){
    @Test
    fun `Test findAll`() {
        val all = chemicalRepository.findAll(PageRequest.of(2, 4, Sort.by("id")))
        println(all)
    }
}